package com.damei.qmui_test_demo;

import android.app.Application;

import com.damei.qmui_test_demo.utils.LogUtils;
import com.lzy.okgo.OkGo;
import com.lzy.okgo.model.HttpHeaders;
import com.lzy.okgo.model.HttpParams;
import com.xuexiang.xui.XUI;

public class MainApplication extends Application {

    @Override
    public void onCreate() {
        super.onCreate();

        XUI.init(this);
        XUI.debug(true);
        OkGo.getInstance().init(this);
        LogUtils.Builder builder = new LogUtils.Builder(this);
    }

    /**
     * 初始化网络请求
     */
    private void initOkGoAction() {
        HttpHeaders headers = new HttpHeaders();
        headers.put("content-type", "application/x-www-form-urlencoded");
        HttpParams params = new HttpParams();
        params.put("agentPhone", "19916218092");
        params.put("smsCode", "1111");
        try {
            OkGo.getInstance()
                    .init(this)
                    .addCommonHeaders(headers)
                    .addCommonParams(params);
        }
        catch (Exception e) {
            e.printStackTrace();
        }
    }
}
